package servlets;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CerrarMesaServlet
 */
@WebServlet("/CerrarMesaServlet")
public class CerrarMesaServlet extends HttpServlet
{
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException
	{
		response.getWriter().append("DOGET");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException
	{
		String monto = request.getParameter("hfTotal");
		String mesa = request.getParameter("hfMesa");
		String fecha = request.getParameter("hfFecha");
		String mozo = request.getParameter("hfMozo");
		
		request.setAttribute("monto", monto);
		request.setAttribute("mesa", mesa);
		request.setAttribute("fecha", fecha);
		request.setAttribute("mozo", mozo);
		
		getServletContext().getRequestDispatcher("/salon/Factura.jsp").forward(request, response);
	}

}
